<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Theron: Theron::EndPoint::Connect</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Theron
   &#160;<span id="projectnumber">6.00.02</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceTheron.html">Theron</a></li><li class="navelem"><a class="el" href="classTheron_1_1EndPoint.html">EndPoint</a></li>  </ul>
</div>
</div><!-- top -->
<div class="contents">
<table cellspacing="0" cellpadding="0" border="0">
  <tr>
   <td valign="top">
      <div class="navtab">
        <table>
          <tr><td class="navtab"><a class="qindexHL" href="classTheron_1_1EndPoint_ad56f5c303641bffa86f9e94d27e1b37d.html#ad56f5c303641bffa86f9e94d27e1b37d">Connect</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="classTheron_1_1EndPoint_ae7d670b129f847a700828ed64951d9e2.html#ae7d670b129f847a700828ed64951d9e2">EndPoint</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="classTheron_1_1EndPoint_a1e0996ed4cc23ab5c1bc5c48ce68d4d1.html#a1e0996ed4cc23ab5c1bc5c48ce68d4d1">GetName</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="classTheron_1_1EndPoint_ac596fbcdb133730fceaaf6f5c720e372.html#ac596fbcdb133730fceaaf6f5c720e372">~EndPoint</a></td></tr>
        </table>
      </div>
   </td>
   <td valign="top" class="mempage">
<a class="anchor" id="ad56f5c303641bffa86f9e94d27e1b37d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Theron::EndPoint::Connect </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>address</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connects this <a class="el" href="classTheron_1_1EndPoint.html" title="Network communication object. ">EndPoint</a> object to another (remote) <a class="el" href="classTheron_1_1EndPoint.html" title="Network communication object. ">EndPoint</a> object. </p>
<p>The remote <a class="el" href="classTheron_1_1EndPoint.html" title="Network communication object. ">EndPoint</a> is typically on another host, connected to the local one by a network connection. It is also possible to use this mechanism to connect different processes on the same host.</p>
<p>The format of the address parameter is "tcp://192.168.10.104:5555" where "192.168.10.104" is the IP address of the remote host and "5555" is the number of the network port on the remote host to which the remote <a class="el" href="classTheron_1_1EndPoint.html" title="Network communication object. ">EndPoint</a> is assigned.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>Unique network address (IP address and port) of the remote <a class="el" href="classTheron_1_1EndPoint.html" title="Network communication object. ">EndPoint</a> instance. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True, if the connection succeeded.</dd></dl>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[])</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// Create a local endpoint using a local IP address provided as a command-line parameter.</span></div>
<div class="line">    <span class="keywordtype">char</span> buffer[256];</div>
<div class="line">    sprintf(buffer, <span class="stringliteral">&quot;tcp://%s:5556&quot;</span>, argv[1]);</div>
<div class="line">    <a class="code" href="classTheron_1_1EndPoint.html">Theron::EndPoint</a> endPoint(<span class="stringliteral">&quot;client&quot;</span>, buffer);</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Connect to the remote endpoint at an IP address provided as a second command-line parameter.</span></div>
<div class="line">    sprintf(buffer, <span class="stringliteral">&quot;tcp://%s:5555&quot;</span>, argv[2]);</div>
<div class="line">    <span class="keywordflow">if</span> (!endPoint.Connect(buffer))</div>
<div class="line">    {</div>
<div class="line">        printf(<span class="stringliteral">&quot;ERROR: Connection failed - check networking is enabled.\n&quot;</span>);</div>
<div class="line">        <span class="keywordflow">return</span> 1;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Construct a framework tied to the local endpoint.</span></div>
<div class="line">    <a class="code" href="classTheron_1_1Framework.html">Theron::Framework</a> framework(endPoint);</div>
<div class="line">}</div>
</div><!-- fragment --> 
</div>
</div>
    </td>
  </tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
